<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j" xmlns:p="http://primefaces.org/ui"
	xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/adminTheme.xhtml">
	<ui:define name="content-header">
		<section class="content-header">
			<h1>
				Add Teacher <small>Manager Teacher</small>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#{request.contextPath}/admin/dashboard.html"><i
						class="fa fa-dashboard"></i>Home</a></li>
				<li><a href="#{request.contextPath}/admin/teacher/view.html">Manager Teacher</a></li>
				<li class="active">Add Teacher</li>
			</ol>
		</section>
	</ui:define>
	<ui:define name="content-main">
		<!-- Small boxes (Stat box) -->
		<div class="row">
			<div class="col-md-12">
				<h:form  id="form-add-code">
					<div class="box box-primary">
						<div class="box-header">
							<h3 class="box-title">New Teacher</h3>
							<p:messages id="messages" showDetail="true" autoUpdate="true" clotable="true" />
						</div>
						<div class="box-body">
							<div class="form-group">
								<h:outputLabel value="Import File Excel:" />
								<p:fileUpload fileUploadListener="#{tab.upLoadFile}"
									mode="advanced" update="messages select-add" auto="true" ></p:fileUpload>
							</div>
							
							<h:panelGroup id="select-add">
							<div class="form-group" style="#{tab.visitInput}">
								<h:outputLabel value="ID:" for="no" />
								<h:inputText styleClass="form-control" id="no" value="#{tab.add.teacherNo}" pt:required="required"
									pt:placeholder="CNPM" />
							</div>
							<div class="form-group" style="#{tab.visitInput}">
								<h:outputLabel value="Name:" />
								<h:inputText styleClass="form-control" id="codeName" value="#{tab.add.teacherName}"
 									pt:placeholder="Công Nghệ Phần Mềm" pt:required="required" />
							</div>
							<div class="form-group" style="#{tab.visitInput}">
								<h:outputLabel value="Gender:" />
								<h:selectOneMenu value="#{tab.add.teacherGender}" tyleClass="form-control" >
									<f:selectItems value="#{tab.gender}"/>
								</h:selectOneMenu>
								
							</div>
							<div class="form-group" style="#{tab.visitInput}">
								<h:outputLabel value="Birth Day:" />
								<h:inputText type="date" styleClass="form-control" id="bd" value="#{tab.add.teacherBirthDay}" >
									
								</h:inputText>
								
							</div>
							<div class="form-group" style="#{tab.visitInput}">
								<h:outputLabel value="Phone:" />
								<h:inputText styleClass="form-control" id="phone" value="#{tab.add.teacherPhone}"
 									pt:placeholder="01662464538"  />
							</div>
							<div class="form-group" style="#{tab.visitInput}">
								<h:outputLabel value="Address:" />
								<h:inputText styleClass="form-control" id="address" value="#{tab.add.teacherAddress}"
 									pt:placeholder="123 duong 18"  />
							</div>
							<div class="panel panel-default" style="#{tab.visitListCode}">
								<div class="panel-heading">Choose :</div>
								<p:dataTable var="s"  value="#{tab.adds}" id="table-add-code" selection="#{tab.select}" rowKey="#{s.teacherNo}" style="margin-bottom:0">
									<p:column selectionMode="multiple" style="width:40px;text-align:center" />
								
									<p:column headerText="ID" style="width:10%;text-align:center" >
										<h:outputText value="#{s.teacherNo}" />
									</p:column>
									<p:column headerText="Name" style="width:25%" >
										<h:outputText value="#{s.teacherName}" />
									</p:column>
									<p:column headerText="Gender" style="width:15%" >
										<h:outputText value="#{s.genderString()}" />
									</p:column>
									<p:column headerText="BirthDay" style="width:15%" >
										<h:outputText value="#{s.teacherBirthDay}" >
											<f:convertDateTime pattern="dd-MMM-yyyy" type="date" />
										</h:outputText>
									</p:column>
									<p:column headerText="Address" style="width:20%" >
										<h:outputText value="#{s.teacherAddress}" />
									</p:column>
									<p:column headerText="Phone" style="width:15%" >
										<h:outputText value="#{s.teacherPhone}" />
									</p:column>
									
								</p:dataTable>
							</div>
							</h:panelGroup>
						</div>
						<!-- /.box-body -->

						<div class="box-footer">
							<p:commandButton action="#{tab.add}"
								styleClass="btn btn-primary" value="Add" update="messages">
							</p:commandButton>
						</div>



					</div>
				</h:form>
				<!-- /.box -->
			</div>
		</div>
		<!-- /.row (main row) -->

	</ui:define>

</ui:composition>
